package cx.zan.utils;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Mxb
 * @version 1.0
 * @date 2020/3/30 22:42
 */
public class RRHolder {
    //threadlocal只是一个工具类
    private static ThreadLocal<HttpServletResponse> responseThreadLocal=new ThreadLocal<>();
    private static ThreadLocal<HttpServletRequest> requestThreadLocal=new ThreadLocal<>();

    public static void setResponse(HttpServletResponse response){
        responseThreadLocal.set(response);
    }
    public static HttpServletResponse getResponse(){
        return responseThreadLocal.get();
    }
    public static void setRequest(HttpServletRequest request){
        requestThreadLocal.set(request);
    }
    public static HttpServletRequest getRequest(){
        return requestThreadLocal.get();
    }
}

